export const getDateStr = (date: Date) => {
    const str = date.getFullYear() + '-' + 
    String(date.getMonth() + 1).padStart(2, '0') + '-' + 
    String(date.getDate()).padStart(2, '0') + ' ' + 
    String(date.getHours()).padStart(2, '0') + ':' + 
    String(date.getMinutes()).padStart(2, '0');
    return str;
}

export const getLastTimeStr = (startStr: string, hours: number) => {
    const startDate = new Date(startStr);
    const endDate = new Date(startDate.getTime() + hours * 60 * 60 * 1000);
    return getDateStr(endDate);
}

export const getListTimeStr = (list: any[]) => {
    return `${list[0]}-${list[1]}-${list[2]} ${list[3]}:${list[4]}`
}